/**
 * 
 */
package com.gkwave.action.service;

import java.io.IOException;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.gkwave.module.bean.FoodMenuBean;
import com.gkwave.module.dao.FoodMenuDAO;

/**
 * @author Administrator
 *
 */
public class FoodMenuListService extends BaseService {

	/**
	 * 
	 */
	private static final long serialVersionUID = 8954670105200349269L;

	/**
	 * 
	 */
	public FoodMenuListService() {
		// TODO Auto-generated constructor stub
	}

	/* (non-Javadoc)
	 * @see com.gkwave.action.service.BaseService#procesRequest(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)
	 */
	@Override
	public void procesRequest(HttpServletRequest request,
			HttpServletResponse response) throws ServletException, IOException {
		// TODO Auto-generated method stub
		String idBranch = request.getParameter("idBranch");
		out = response.getWriter();
		if(idBranch!=null){
		try{
			Integer id_branch = Integer.parseInt(idBranch);
			FoodMenuDAO dao = new FoodMenuDAO();
			FoodMenuBean bean = dao.getFoodMenuListByBranch(id_branch);
			xmlResponse = bean.marsel(bean, "FoodMenu", "menu");
		}catch (Exception e) {
			// TODO: handle exception
			e.printStackTrace();
		}
			}else{
				xmlResponse = "Error... Input is empty!!!";
			}
		System.out.println(xmlResponse);
		out.println(xmlResponse);
	}

}
